Looked at it, scratched my head a few times, had a couple of goes at it, scratched my head a bit more and then came up with the solution.
It turned out that the array was cleared every time a value was added (I used dumpvar(name_of_the_array)) to monitor that.
Adding a simple "". before the $argv was added, solved that issue.
Have a go with this:
CatchEvent OnLapperStart()
GlobalVar $Rule; #Have Set $Rule[1] - $Rule[16]
GlobalVar $CloseServerRulesOne; #ButtonRow 1
GlobalVar $CloseServerRulesTwo; #ButtonRow 2
$CloseServerRulesOne = "&Close";
$CloseServerRulesTwo = "&Close";
EndCatchEvent
Sub SetServerRules($keyflags,$id)
$AP_HT = 52; #Local Var
closeadminpanelother2(); #A close function
openPrivButton( "ServerRulesChangeTitle",70,$AP_HT+10,60,4,4,-1,96, "^2blablahblah %nl%^2WAAAW new line blablabnla!");
FOR($i=1;$i<17;$i=$i+1)
openPrivButton( "ServerRule_".$i,70,$AP_HT+18,55,4,5,-1,96, "^3".$i.". ".$Rule[$i] ); #Line of rule
openPrivTextButton( "ServerRuleSet_".$i,125,$AP_HT+18,5,4,5,16, "^3Set ServerRule","^0Set",60,ServerRuleSet); #Set button
$AP_HT=$AP_HT+4; #Buttonheight + 4
#closing vars
$CloseServerRulesOne = $CloseServerRulesOne . "&ServerRule_".$i;
$CloseServerRulesTwo = $CloseServerRulesTwo . "&ServerRuleSet_".$i;
ENDFOR
openPrivButton( "ServerRulesClose",70,$AP_HT+19,60,5,5,-1,16, "^3OK",AdminPanelOther2); #This doesnt work if you copy this code hahah
EndSub
Sub ServerRuleSet( $id, $argv )
$Rule[ToNum(trim(subStr( $id,14 )))] = "".$argv; #ToNum(trim(subStr( $id,14 ))) = trim first 14 chars and convert it to ToNum()
SetServerRules(0,0);
EndSub